package com.my.demo.utils;

import java.util.Random;

/**
 * @author liangyuanshao
 * @date 2021/12/18 - 21:05
 */
public class SaltUtils {
  public static String getSalt(int n){
    char[] chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890!@#$%^&*()".toCharArray();
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < n; i++) {
      char aChar = chars[new Random().nextInt(chars.length)];
      sb.append(aChar);
    }
    return sb.toString();
  }
}
